package com.starblink.utils.app.vm

import androidx.lifecycle.MutableLiveData
import com.starblink.frame.base.BaseViewModel

class FadeInAnimatorVM : BaseViewModel() {
    val fadeInAnimatorData: ArrayList<String> = ArrayList()
    val fadeInAnimatorLiveData: MutableLiveData<Boolean> = MutableLiveData()
    fun addFadeInAnimatorData() {
        fadeInAnimatorData.add(0,getRoudomImageStr())
        fadeInAnimatorLiveData.postValue(true)
    }
    fun subFadeInAnimatorData() {
        if(fadeInAnimatorData.isNotEmpty()) {
            fadeInAnimatorData.removeFirst()
            fadeInAnimatorLiveData.postValue(false)
        }
    }

    fun getRoudomImageStr():String{
        val data= arrayListOf("https://www.pricerunner.com/product/640x640/3002248624/Kiki-Health-Zeolite-Powder-120g.jpg",
        "https://prod-kproject-oss.starblink.co/klarna_goods/hsamuel/710c7fea145f7e79296c34293b455b20.jpg",
        "https://www.pricerunner.com/product/640x640/3002248624/Kiki-Health-Zeolite-Powder-120g.jpg",
        "https://prod-kproject-oss.starblink.co/klarna_goods/hsamuel/710c7fea145f7e79296c34293b455b20.jpg",
        "https://cdn-img.prettylittlething.com/b/e/1/9/be19fc009c105804292333c853fcf2d893ad1c12_clz1363_3.jpg",
        "https://prod-kproject-oss.starblink.co/klarna_goods/prettylittlething/266c5a3384ddb56c0b8c75dbee20a997.jpg",
        "https://cdn-img.prettylittlething.com/1/2/d/a/12daf6f4150c05e627585ffadc8cf7037ca37998_clz1363_4.jpg",
        "https://cdn-img.prettylittlething.com/4/b/5/1/4b51f9ee56b9ec6248a67a0353aefa2369b5ee5e_clz1363_2.jpg",)
        val random = (0 until data.size).random()
        return data[random]
    }
}